package com.app.shop.adapters;

import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;


import com.app.shop.R;
import com.app.shop.beans.OrderBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;



public class  OrderListAdapter extends BaseQuickAdapter<OrderBean, OrderListAdapter.ViewHolder> {

    public OrderListAdapter(int layout, @Nullable List<OrderBean> data) {
        super(layout, data);
    }

    @Override
    protected void convert(ViewHolder holder, OrderBean bean) {
        holder.tv_name.setText("订单编号：" + bean.getOrder_id());
        holder.tv_price.setText("￥" + bean.getPrice());
        holder.tv_new.setText("下单时间：" + bean.getTime());
        holder.addOnClickListener(R.id.tv_status);
    }


    public class ViewHolder extends BaseViewHolder {

        TextView tv_name;
        TextView tv_new;
        TextView tv_price;
        TextView tv_status;

        public ViewHolder(View view) {
            super(view);
            tv_name = view.findViewById(R.id.tv_list_item);
            tv_new = view.findViewById(R.id.tv_new);
            tv_price = view.findViewById(R.id.tv_price);
            tv_status = view.findViewById(R.id.tv_status);
        }
    }
}
